<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
		<script type="text/javascript">
			
			function createPerson(name,age,gender){
				
				var obj=new Object();
				obj.name=name;
				obj.age=age;
				obj.gender=gender;
				obj.sayName=function(){
						alert(this.name);
				};
				
				return obj;
			}
			
			var obj1=createPerson("吴彦祖",18,"男");
			var obj2=createPerson("彭于晏",20,"男");
			var obj3=createPerson("梅艳芳",30,"女");
			
			console.log(obj1);
			console.log(obj2);
			console.log(obj3);
			
			obj1.sayName();
			obj2.sayName();
			obj3.sayName();
			
			
			
		</script>
	</head>
	<body>
	</body>
</html>
